package com.yzh.oop8.teacher;

public class Test {
    public static void main(String[] args) {
        Book book1 = new Book("sdyxzh","123金庸","清华大学出版社",34.7);
        Book book2 = new Book("bfmnzh","321梁羽生","清华大学出版社",34.1);
        System.out.println(book1.compareTo(book2));


        //使用外部比较器比较图书
        Comparator  comp1 = new BookNameComparator();
        int n =comp1.compare(book1,book2);
        System.out.println(n);

        //使用外部比较器比较图书
        Comparator  comp2 = new BookPublisherAuthorComparator();
        int n2 = comp2.compare(book1,book2);
        System.out.println(n2);
    }
}
